package com.itheima.common;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.itheima.pojo.OrderDetail;

import java.util.ArrayList;
import java.util.List;

public class ExcelListener extends AnalysisEventListener<OrderDetail> {

    private static List<OrderDetail> list=new ArrayList<>();

    @Override
    public void invoke(OrderDetail orderDetail, AnalysisContext analysisContext) {
list.add(orderDetail);

    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("全部解析完成");
    }

    public static List<OrderDetail> getList(){
        return list;
    }
}
